<?php
/**
 * Created by PhpStorm.
 * User: hasee
 * Date: 2018/3/21
 * Time: 14:50
 */
use yii\widgets\ActiveForm;
?>
<div  class="top1 view" id="basic">

    <div class="wapper1">
        <img src="/img/jb.png">
    <ul>
        <li>
            <span>姓名</span>
            <input type="text" name="Registration[name]" id="registration-name"  onblur="Registration_name()"    value="<?= $model->name?>">
            <span>性别</span>
            <input  type="radio" name="Registration[genter]" <?= $model->genter=='男'?'checked ':''?>  value="男"> <span>男</span>
            <input  type="radio" name="Registration[genter]" <?= $model->genter=='女'?'checked ':''?> value="女"> <span>女</span>
        </li>

        <li>
                <span>联系电话</span>
                <input type="text" id="registration-telephone" onblur="Registration_telephone()"  name="Registration[telephone]" value="<?= $model->telephone?>">
        </li>

        <li>
                <span>国籍</span>
                <input type="text" id="registration-nationality"  name="Registration[nationality]" onblur="Registration_nationality()" value="<?= $model->nationality?>">
        </li>

        <li>
               <span>证件类型</span>
                <select id="registration-card_type"  name="Registration[card_type]" aria-invalid="false" style="background: rgba(0,115,172,0.1);
    border: none;border-left: 2px solid rgba(0,132,177,1);margin-left:5%;">
                   
                    <option value="身份证" <?= $model->card_type=='身份证'?'selected':''?>>身份证</option>
                    <option value="护照" <?= $model->card_type=='护照'?'selected':''?>>护照</option>
                    <option value="港澳身份证" <?= $model->card_type=='港澳身份证'?'selected':''?>>港澳身份证</option>
                </select>
                
        </li>
         <li>
               <span>证件号码</span>
                
                <input type="text" id="registration-card_num"  name="Registration[card_num]" onblur="Registration_card_num()"  style='margin-left:6%;'  value="<?= $model->card_num?>">
        </li>

        <li>
                <span>单位</span>
                <input type="text" id="registration-dealer"  name="Registration[dealer]" onblur="Registration_dealer()" value="<?= $model->dealer?>">
        </li>

        <li>
                <span>职位</span>
                <input type="text" id="registration-post"   onblur="registration_post()"  name="Registration[post]" value="<?= $model->post?>">
        </li>
       
            <?php if($model->code):?>
                 <li>
                <span><label class="control-label" for="registration-accompanied">
                        所属嘉宾
                    </label></span>
                     <input type="text" id="registration-accompanied" onblur="registration_accompanied()"  name="Registration[accompanied]" value="<?= $model->accompanied?>">
                  </li>   
            <?php endif;?>
           
       

        <li>
                <span>备用联系人</span>
                <input type="text" id="registration-spare_contact" onblur="registration_spare_contact()" name="Registration[spare_contact]" value="<?= $model->spare_contact?>">
        </li>

        <li>
                <span>备用联系人电话</span>
                <input type="text" id="registration-spare_contact_phone" style="width: 50%; " onblur="registration_spare_contact_phone()" name="Registration[spare_contact_phone]" value="<?= $model->spare_contact_phone?>">
        </li>
    </ul>
</div>

</div>

<script type="text/javascript">
    function Registration_name(){
        var value=$('#registration-name').val();
        if(value==''){
            alert('姓名不能为空');
        }

    }
    function Registration_telephone(){
        var value=$('#registration-telephone').val();
        if(value==''){
            alert('电话不能为空');
        }

        var myreg=/^[1][0-9]{10}$/;  
          if (!myreg.test(value)) { 
          alert('电话格式不正确'); 
              return false;  
          } 

    }
    function Registration_nationality(){
        var value=$('#Registration-nationality').val();
        if(value==''){
            alert('国籍不能为空');
        }

    }
    function Registration_card_num(){
        var value=$('#Registration-card_num').val();
        if(value==''){
            alert('证件号码不能为空');
        }

    }
    function Registration_dealer(){
        var value=$('#Registration-dealer').val();
        if(value==''){
            alert('单位不能为空');
        }
        

    }
    function registration_post(){
        var value=$('#registration-post').val();
        if(value==''){
            alert(' 职位不能为空');
        }

    }
    function registration_accompanied(){
        var value=$('#registration-accompanied').val();
        if(value==''){
            alert('所属嘉宾不能为空');
        }

    }
    function registration_spare_contact(){
        var value=$('#registration-spare_contact').val();
        if(value==''){
            alert('备用联系人不能为空');
        }

    }
    function registration_spare_contact_phone(){
        var value=$('#registration-spare_contact_phone').val();
        if(value==''){
            alert('备用联系人电话不能为空');
        }
         var myreg=/^[1][0-9]{10}$/;  
          if (!myreg.test(value)) { 
          alert('电话格式不正确'); 
              return false;  
          } 
    }

</script>






